﻿using CommData;
using CommHelper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace SocketSvrBiz
{
    partial class BaseBiz
    {
        private void Test(byte[] json)
        {
            byte[] response = null;
            string method = MethodBase.GetCurrentMethod().Name;
            try
            {
                var item = NetworkDataHelper.GetNetworkDataHelper.GetJsonObject<Domain.Entities.OperModel>(json);

                item.result = item.x + item.y;
                item.Id = KeyNumber.CreateTablePrimaryKey_Guid();
                item.Operation = method;
                _OperationServices.SaveOperModel(item);

                response = NetworkDataHelper.GetNetworkDataHelper.GetResponseBytes(MessageStatus.Success, method, item, Ipaddress);
                sendResponseAll(response);
            }
            catch (Exception e)
            {
                LogHelper.WriteErrorLog(e.Message);
            }
        }
    }
}